\ProvidesPackage{CCNU-format}[2022/08/13 v1.0 A internship or probation template for Central China Normal University]
\RequirePackage{xeCJKfntef}

\renewcommand\emph[1]{{\heiti{#1}}} %将强调改为变黑体
%绘图宏包
\RequirePackage{tikz}
\usetikzlibrary{intersections,calc,through,shapes,positioning}

\RequirePackage{siunitx}  %用于输入单位和数字
%插图宏包
\RequirePackage{graphicx}
\RequirePackage{float}
%两个图文混排宏包
\RequirePackage{./Setting/text-figure} 
\RequirePackage{wrapfig}

%定理设置宏包
\RequirePackage{ntheorem}

%%% 列表设置宏包
\usepackage{paralist}  %罗列宏包
\usepackage{enumitem}

\xeCJKsetup{underdot = {format=\LARGE} } %设置着重点
%%% 目录设置
\RequirePackage[titles]{tocloft}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{0} %使得目录只输出到chapter
\renewcommand{\cftdot}{\large$\cdot$} %设置目录的导引点为粗点
\renewcommand{\cftdotsep}{0.7} %设置导引点之间的距离
\renewcommand{\cftchapdotsep}{\cftdotsep} %设置目录后导引点距离
%\renewcommand{\cftbeforechapskip}{0em}

%各级标题格式设置
\CTEXsetup[
  name   = {{\S},{}},
  number = {\arabic{chapter}},
  aftername = {\hspace{6pt}},
  format = {\heiti  \centering \zihao{2}}
]{chapter}
\renewcommand\thechapter{\Roman{chapter}}
\ctexset{
    section = {
        number = {\zhnum{section}},
        format+ = {\zihao{4} \heiti \raggedright},
        name = {\hspace{1.3em},、},
        aftername = {\hspace{4pt}},
        beforeskip = {2ex plus 1ex minus .5ex},
        afterskip = {1ex plus .2ex minus 1ex}
    },
    subsection = {
        number = {\zhnum{subsection}},
        format+ = {\zihao{-4} \heiti \raggedright \subsectionFormat},
        name = {\hspace{1.3em}（,）},
        aftername = {\hspace{1pt}},%控制一下间距
        beforeskip = {1ex plus .2ex minus .2ex},
        afterskip = {1ex plus .2ex minus .2ex},
    },
    subsubsection = {
        number = {\ttfamily\arabic{subsubsection}},
        format+ = {\zihao{-4} \raggedright \subsubsectionFormat},
        name = {\hspace{1.7em},.},
        aftername = {\hspace{1pt}},%控制一下间距
        beforeskip = {1ex plus .2ex minus .2ex},
        afterskip = {1ex plus .2ex minus .2ex},
    }
}

%添加配色
\RequirePackage{color}
\definecolor{ColdBlue}{RGB}{32,106,189}
\definecolor{ColdBlueLight}{RGB}{85,164,254}
\definecolor{MilkGreen}{RGB}{130, 173, 119}
\newcommand{\coldblue}[1]{{\color{ColdBlue}#1}}
\newcommand{\coldbluelight}[1]{{\color{ColdBlueLight}#1}}
\newcommand{\milkgreen}[1]{{\color{MilkGreen}#1}}
% \usepackage{titlesec}%用了会炸，有冲突
\usepackage{tcolorbox}
\newcommand\subsectionFormat[1]{
  % \tcbox[on line]{\milkgreen{#1}}%可以考虑设计盒子
  \coldblue{#1}
}
\newcommand\subsubsectionFormat[1]{
  % \tcbox[on line]{\milkgreen{#1}}%可以考虑设计盒子
  \coldbluelight{#1}
}

%设置页眉页脚
\RequirePackage{fancyhdr}
\fancypagestyle{plain}{\pagestyle{fancy}}
\pagestyle{fancy}
\fancyhf{}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0pt} % 控制页眉与正文的分\线
\renewcommand{\footrulewidth}{0pt}   % 控制页脚的分隔线

%%%键值控制设置
\RequirePackage{expl3}
\RequirePackage { l3keys2e, xparse }
\ExplSyntaxOn 
\keys_define:nn{information} %为 information 模块设置键值对
{
  school.tl_set:N  = \l_school_tl,
  major.tl_set:N   = \l_major_tl,
  name.tl_set:N    = \l_name_tl,     %将 name 保存到一个 tl 变量中 %字符串
  ID.tl_set:N      = \l_ID_tl,       %将 age 保存到一个 tl 变量中 %字符串
  periodA.tl_set:N  = \l_periodA_tl,   %将 period 保存到一个 tl 变量中 %字符串
  periodB.tl_set:N = \l_periodB_tl,  
  institution.tl_set:N = \l_institution_tl
}
\NewDocumentCommand{\school}{} % 构建一个命令，用于输出学校
{
  \tl_use:c {l_school_tl}  
}
\NewDocumentCommand{\major}{} % 构建一个命令，用于输出专业
{
  \tl_use:c {l_major_tl}  
}
\NewDocumentCommand{\name}{} % 构建一个命令，用于输出姓名
{
  \tl_use:c {l_name_tl}  
}
\NewDocumentCommand{\ID}{} % 构建一个命令，用于输出学号
{
  \tl_use:c {l_ID_tl}  
}
\NewDocumentCommand{\periodA}{} % 构建一个命令，用于输出见习时间
{
  \tl_use:c {l_periodA_tl}   
}
\NewDocumentCommand{\periodB}{} % 构建一个命令，用于输出实习时间
{
  \tl_use:c {l_periodB_tl}   
}
\NewDocumentCommand{\institution}{} % 构建一个命令，用于输出实习单位
{
  \tl_use:c {l_institution_tl}   
}
\ExplSyntaxOff